<?php

class Application_Form_Menu extends Zend_Form
{
    public function init()
    {
        $this->setName('Menu');
        
        $menu_id = new Zend_Form_Element_Hidden('menu_id');
        $menu_id->addFilter('Int');

        $name = new Zend_Form_Element_Text('name');
        $name->setLabel('Tên menu')
              ->setRequired(true)
              ->addFilter('StripTags')
              ->addFilter('StringTrim')
              ->addValidator('NotEmpty');
                      
        $description = new Zend_Form_Element_Textarea('description');
        $description->setLabel('Mô tả')
               ->setRequired(true)
               ->addFilter('StripTags')
               ->addFilter('StringTrim')
               ->addValidator('NotEmpty');
              
        $user_id = new Zend_Form_Element_Hidden('user_id');
        				
        
        $user_name = new Zend_Form_Element_Hidden('user_name');
       /* $user_name->setLabel('Tên người dùng')
              ->setRequired(true)
              ->addFilter('StripTags')
              ->addFilter('StringTrim')
              ->addValidator('NotEmpty');*/
        					  
               
       	$language = new Zend_Form_Element_Select('language');
        $language->setLabel('Ngôn ngữ')
                ->setRequired(true)
                ->addMultiOptions(array(
                 	'en' => 'English',
                	'vi' => 'VietNam'
        ));
        $submit = new Zend_Form_Element_Submit('submit');
        $submit->setAttrib('id', 'submitbutton');
        
        $cancel = new Zend_Form_Element_Submit('cancel');
        $cancel->setAttrib('id', 'cancelbutton');
        
        $this->addElements(array($name, $language, $description, $user_name ,$user_id, $menu_id, $submit, $cancel));
    }
}